package com.csht.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.csht.mapper.CshtUserMapper;
import com.csht.model.CshtUser;
import com.csht.service.RegisterService;

/**
 * 注册service
 * @author chenhuiyan
 *
 */
@Service
public class RegisterServiceImpl implements RegisterService {
	
	@Autowired
	private CshtUserMapper cshtUserMapper;

	/**
	 * 根据用户名查询用户
	 * @param username
	 * @return
	 * @throws Exception
	 */
	@Override
	public CshtUser getUserByUsername(String username) throws Exception {
		CshtUser cshtUser = cshtUserMapper.getUserByUsername(username);
		return cshtUser;
	}

	/**
	 * 用户注册
	 * @param cshtUser
	 * @throws Exception
	 */
	@Override
	public void userRegister(CshtUser cshtUser) throws Exception {
		cshtUserMapper.userRegister(cshtUser);
	}

	/**
	 * 根据手机号查找用户
	 * @param userTel
	 * @return
	 * @throws Exception
	 */
	@Override
	public CshtUser findUserByTel(String userTel) throws Exception {
		return cshtUserMapper.findUserByTel(userTel);
	}

}
